package com.wannengbang.storemobile.homepage;

import androidx.appcompat.app.AppCompatActivity;
import butterknife.BindView;
import butterknife.ButterKnife;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;

import com.wannengbang.storemobile.R;
import com.wannengbang.storemobile.base.BaseActivity;
import com.wannengbang.storemobile.widget.AppTitleBar;

public class IncomingUserTypeActivity extends BaseActivity {
    @BindView(R.id.title_bar)
    AppTitleBar titleBar;
    @BindView(R.id.ll_store_1)
    RelativeLayout ll_store_1;
    @BindView(R.id.ll_store_2)
    RelativeLayout ll_store_2;
    @BindView(R.id.ll_store_3)
    RelativeLayout ll_store_3;
    private String channel_type;
    private int agent_id;
    private String supplementary_information;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_incoming_user_type);
        ButterKnife.bind(this);

        initView();
        initEvent();


    }

    protected void initView() {
        Intent intent = getIntent();
        agent_id = intent.getIntExtra("agent_id", 0);


        channel_type = intent.getStringExtra("channel_type");
        supplementary_information = intent.getStringExtra("supplementary_information");

        if ("2".equals(channel_type)) {
            ll_store_2.setVisibility(View.GONE);
            ll_store_3.setVisibility(View.GONE);
        }

    }

    protected void initEvent() {
//        channel_type  1 银盛标准版 2银盛智能版
        ll_store_1.setOnClickListener(v -> {
            Intent intent = new Intent(this, StoreDataActivity.class);
            intent.putExtra("channel_type", channel_type);
            intent.putExtra("agent_id", agent_id);
            intent.putExtra("type", "1");
            intent.putExtra("supplementary_information", supplementary_information);
            startActivity(intent);
            finish();

        });
        ll_store_2.setOnClickListener(v -> {
            Intent intent = new Intent(this, StoreDataActivity.class);
            intent.putExtra("channel_type", channel_type);
            intent.putExtra("agent_id", agent_id);
            intent.putExtra("type", "2");
            intent.putExtra("supplementary_information", supplementary_information);
            startActivity(intent);
            finish();
        });
        ll_store_3.setOnClickListener(v -> {
            Intent intent = new Intent(this, StoreDataActivity.class);
            intent.putExtra("channel_type", channel_type);
            intent.putExtra("agent_id", agent_id);
            intent.putExtra("type", "3");
            intent.putExtra("supplementary_information", supplementary_information);
            startActivity(intent);
            finish();
        });
    }
}